package br.org.etec.dotcao.mailer;

import java.util.HashSet;
import java.util.Set;

public class ReceiverReader extends Reader<Set<Receiver>> {

	private Set<Receiver> receivers = new HashSet<Receiver>();

	public ReceiverReader(String source) {
		super(source);
	}
	
	@Override
	protected void process(String line) {
		if(line == null || line.isEmpty()){
			return;
		}
		
		line = line.trim().toLowerCase();
		
		receivers.add(new Receiver(line, line));
	}

	@Override
	public Set<Receiver> get() {
		return receivers;
	}
}
